import React from 'react';

/** 申请页面上下文类型 */
export interface IintentionContextAPI {
  styleFixCls: string;
  infoObj: Record<string, any>;
  reloadDetail: () => void;
  setInvalidState: (res: Record<string, any>) => void;
  invalidState: Record<string, any>;
  curRes: Record<string, any>;
  setOAMessageRun: (res: Record<string, any>) => any;
  taskId: string;
}

/** 申请管理上下文 */
const context: IintentionContextAPI = {
  styleFixCls: '',
  infoObj: {},
  reloadDetail: () => {},
  setInvalidState: () => {},
  invalidState: {},
  curRes: {},
  setOAMessageRun: () => {},
  taskId: '',
};

const IntentionControllerContext = React.createContext<IintentionContextAPI>(context);

export { IntentionControllerContext };
